<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
<title>title</title>
<link rel="stylesheet" href="../assets/agile/css/ratchet/css/ratchet.min.css">
<link rel="stylesheet" href="../assets/agile/css/flat/flat.component.css">
<link rel="stylesheet" href="../assets/agile/css/flat/flat.color.css">
<link rel="stylesheet" href="../assets/agile/css/flat/iconline.css">
<link rel="stylesheet" href="../assets/app/css/app.css" />
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/jquery.js"></script>
<script type="text/javascript" src="../script/config.js"></script>
<script type="text/javascript" src="../script/local.js"></script>
<script type="text/javascript" src="../script/common.js"></script>
<script type="text/javascript" src="../script/jquery.form.js"></script>
</head>
<body>

<section style="background:#fff;margin-top:0px !important;">
	<div class="create_goods">
		<div class="cash_box">
		<p>累计收入：<span class="total_money"></span>元，累计(提现/充值)：<span class="z_money"></span>元，佣金余额：<span class="active_price"></span>元</p>
		<p>佣金余额可实时充值到您的云购帐户，满100元时才可申请提现。</p>
		<p>备注:提现手续费2元/次</p>
		</div>
		<form action="" method="post" class="cash-form">
			<p>可提现金额：<span class="active_price"></span> 元 余额满100元时才可以申请提现</p>
			<div class="block10"></div>
			<p><span class="p-span">申请提现金额：</span><input type="number" name="money" style="margin-bottom: 10px;height:35px;width:90px;padding-right:0;"/> 元 <em>*</em></p>
			<p><span class="p-span">开  户 人：</span><input type="text" name="txtUserName"/><em>*</em></p>
			<p><span class="p-span">银行名称：</span><input type="text" name="txtBankName"/><em>*</em></p>
			<p><span class="p-span">开户支行：</span><input type="text" name="txtSubBank"/><em>*</em></p>
			<p><span class="p-span">银行帐号：</span><input type="text" name="txtBankNo"/><em>*</em></p>
			<p><span class="p-span">联系电话：</span><input type="text" name="txtPhone"/><em>*</em></p>
			<input type="hidden" name="send" value="send"/>
			<p><button type="submit" class="common-btn">提交</button></p>
		</form>
		<div class="block30"></div>
	</div>
</section>
<script type="text/javascript">
apiready = function(){
	if(getUserinfo()){
		var userinfo = getUserinfo();
		GetJPData(config.url+'/app.php?act=agentcashout&uid='+userinfo.uid,{},function(data){
			if(data['status']){
				$('span.total_money').text(data['total_money']);
				$('span.z_money').text(data['z_money']);
				$('span.active_price').text(data['active_price']);
				if(data['send'] == 'ok'){
					$('form').show();
				}
			}
		});
		
		$('form').submit(function(){
			$(this).ajaxSubmit({
				type:'POST',
				url:config.url+'/app.php?act=agentcashout&uid='+userinfo.uid,
				beforeSend:function(xhr){
					api.showProgress({title:'正在提交',text:''});
				},
				success:function(data){
					api.hideProgress();
					if(data['status']){
						api.alert({msg:data['msg']},function(index,err){
							appClose('agentcashout',api);
						});
					}else{
						$.PageDialog.fail(data['msg']);
					}
				}
			});
			return false;
		});
		
	}else{
		$.PageDialog.fail('请登录用户');
	}
};
</script>
</body>
</html>